[Java6] Same source code, Eclipse build success but Maven (javac) fails

Posted by EnToutCas on Stack Overflow See other posts from Stack Overflow or by EnToutCas
Published on 2009-10-22T19:45:32Z Indexed on 2011/01/03 23:54 UTC
Read the original article Hit count: 190

Keep getting this error when compiling using Maven:

type parameters of <X>X cannot be determined; no unique maximal instance exists for type variable X with upper bounds int,java.lang.Object

Generics type interference cannot be applied to primitive types. But I thought since Java5, boxing/unboxing mechanism works seamlessly between primitive types and wrapper classes.

In any case, the strange thing is Eclipse doesn't report any errors and happily compiles. I'm using JDK1.6.0_12. What could possibly be the problem here?

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse